<!--
 * @Project_description: tree
-->
<style lang="scss" scoped>
//@import url(); 引入公共css类
</style>
<template>
  <ljs-treeChoose   :disabled="disabled"   v-model="list" :ids="value"  :props="props" :checkStrictly="checkStrictly" :multiple="multiple" :showAllLevels="showAllLevels" :keywordsFilter="keywordsFilter" :clearable="clearable" :submitText="submitText" :cancelText="cancelText" :chooseMode="chooseMode"     @getChooseValue="getChooseValue"  @close="close" ></ljs-treeChoose>
</template>

<script>
import  ljsTreeChoose from './ljs-treeChoose.vue'
// import引入的组件需要注入到对象中才能使用
export default {
  name: 'kw-tree', //文件名
  components: {
    ljsTreeChoose
  }, //组件
  props: {
    value: {
      type: Array,
      default: () => {
        return []
      }
    },
    list: {
      type: Array,
      default: () => {
        return []
      }
    },
    disabled: {
      type: Boolean,
      default: false
    },
    checkStrictly: {
      type: Boolean,
      default: false
    },
    multiple: {
      type: Boolean,
      default: false
    },
    showAllLevels: {
      type: Boolean,
      default: true
    },
    keywordsFilter: {
      type: Boolean,
      default: false
    },
    clearable: {
      type: Boolean,
      default: false
    },
    submitText: {
      type: String,
      default: '确定'
    },
    cancelText: {
      type: String,
      default: '取消'
    },
    chooseMode: {
      type: String,
      default: 'line'
    },
    label:{
      type: String,
      default: 'label'
    },
    id: {
      type: String,
      default: 'id'
    },
    children: {
      type: String,
      default: 'children'
    }
  }, // props
  data() {
    // 这里存放数据
    return {}
  },
  computed: {
    props() {
      return {
        label: this.label,
        id: this.id,
        children: this.children
      }
    }
  }, // 监听属性 类似于data概念
  watch: {},
  methods: {
    getChooseValue(ids,items) {
      this.$emit('input', ids)
      this.$emit('getChooseValue', ids,items)
    },
    close() {
      this.$emit('close')
    }
  },
}
</script>
